﻿package com.msjt.service.impl;

import java.util.List;

import javax.annotation.Resource;

import com.msjt.dao.PictureDAO;
import com.msjt.entity.Picture;
import com.msjt.service.IPictureService;
/**
 * name:PictureService
 * function:图片模块业务逻辑类
 * author: kw
 * time:2013.8.28
 * updateTime:
 */
public class PictureService implements IPictureService {
	@Resource
	private PictureDAO pictureDao;

	public PictureDAO getPictureDao() {
		return pictureDao;
	}

	public void setPictureDao(PictureDAO pictureDao) {
		this.pictureDao = pictureDao;
	}
	
	//主页面加载图片地址，5-9张，按上传时间排序
	/* (non-Javadoc)
	 * @see com.msjt.service.impl.IPictureService#getPictureIndex()
	 */
	public List<Picture> getPictureIndex(){
		return this.pictureDao.getPictureIndex();
	}
	//前台后台查看图片列表，分页
	/* (non-Javadoc)
	 * @see com.msjt.service.impl.IPictureService#getPicturePage(int, int)
	 */
	public List<Picture> getPicturePage(int pageIndex,int pageSize){
		return this.pictureDao.getPicturePage(pageIndex, pageSize);
	}
	//新上传图片
	/* (non-Javadoc)
	 * @see com.msjt.service.impl.IPictureService#addPicture(com.msjt.entity.Picture)
	 */
	public boolean addPicture(Picture picture){
		return this.pictureDao.addPicture(picture);
	}
	//修改图片信息
	/* (non-Javadoc)
	 * @see com.msjt.service.impl.IPictureService#updatePicture(com.msjt.entity.Picture)
	 */
	public boolean updatePicture(Picture picture){
		return this.pictureDao.updatePicture(picture);
	}
	//删除图片
	/* (non-Javadoc)
	 * @see com.msjt.service.impl.IPictureService#deletePicture(com.msjt.entity.Picture)
	 */
	public boolean deletePicture(Picture picture){
		return this.pictureDao.deletePicture(picture);
	}
	//根据ID得到图片的详细信息
	/* (non-Javadoc)
	 * @see com.msjt.service.impl.IPictureService#getPictureInfo(com.msjt.entity.Picture)
	 */
	public Picture getPictureInfo(Picture picture){
		return this.pictureDao.getOnePicture(picture);
	}

	public Integer getPictureCount() {
		return this.pictureDao.getPictureCount();
	}

	public boolean deleteMore(String idString) {
		// TODO Auto-generated method stub
		return this.pictureDao.deleteMore(idString);
	}

	public List<String> getPicturePath(String idString) {
		// TODO Auto-generated method stub
		return this.pictureDao.getPicturePath(idString);
	}
}
